library(ggplot2)

paneld <- read.csv("elderly.csv",header=T, stringsAsFactors=FALSE)
paneld$pe <- paneld$c1
paneld$se <- paneld$c2
paneld$lb <- paneld$pe- 1.96*paneld$se
paneld$ub <- paneld$pe+ 1.96*paneld$se

#Category Factors
paneld$col <- factor (paneld$c3, levels=1)
paneld$group <- factor(paneld$c4,levels=c(2,1),
                       labels=c("Feel Close to Elderly","Feel Close to Christian")[2:1])

f1 = ggplot(data = paneld, aes(x = group, y = pe, width=0.5,ymin = lb, ymax = ub, color=col))

f1 = f1 + geom_pointrange(size=0.25, position = position_dodge(width=.5))
f1 = f1 + scale_shape_manual(values=c(22,22))  
f1 = f1 + scale_fill_manual(values=c("black","black"))

#Error Bars
f1 = f1+ geom_errorbar(aes(ymin=paneld$pe- paneld$se, ymax=paneld$pe+ paneld$se), width=.1)

f1 = f1 + coord_flip()
f1 = f1 + geom_hline(yintercept=0, linetype="longdash", size=0.5)
f1 = f1 + labs( y= "Treatment Effect", x = "Dependent Variable", color = "Category")

#Limits - Set this to whatever you'd like limits to be.
#f1 = f1 + scale_y_continuous(limits = c(-0.2,0.2))

#Theme
f1 =f1+ theme(plot.background= element_rect(fill="grey100"),
              panel.background= element_rect(fill="grey100", color= "grey75"),
              panel.grid.major = element_line(color= "grey75"),
              panel.grid.minor = element_line(color= "grey80"),
              panel.grid.major.y = element_blank(),
              panel.grid.minor.y = element_blank(),
              panel.spacing.x = unit(12,"point"),
              legend.position = c(-0.9,0.15),
              legend.background = element_rect(fill="grey95")
              )


  
print(f1)